layui.use(['layer', 'form', 'admin', 'laydate', 'ax', 'formSelects','upload'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;
    var upload = layui.upload;

    // 添加表单验证方法
    form.verify({
    	scoring: [/^\d+\.?\d{0,1}$/, '格式错误！']
    });

    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var id = $("#id").val();
        var scoring = $("#scoring").val();
        var data = {
        		id: id,
        	scoring: scoring,
            status:2
        }
        // 异步请求
        $.ajax({
            url: Feng.ctxPath + "/modular/activity_apply/update",
            data: JSON.stringify(data),
            type: "post",
            contentType: "application/json;charset=UTF-8",
            async: false,//关闭异步请求
            dataType: "json",
            success: function (data) {
                if (data.code == 200) {
                    Feng.success("操作成功！");
                    //传给上个页面，刷新table用
                    // window.parent.location.reload();
                    admin.putTempData('formOk', true);
                    //关掉对话框
                    admin.closeThisDialog();
                } else {
                    Feng.success("操作失败！" + data.message);
                }
            }
            ,
            error: function (data) {
                Feng.error("添加失败！" + data.message)
            }
        });
    });
    
});